Socket
Socket
Sign inDemoInstall

rollup-plugin-esbuild

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-esbuild

[esbuild](https://github.com/evanw/esbuild) is by far one of the fastest TS/ESNext to ES6 compilers, so it makes sense to use it over Babel/TSC with Rollup to take advantage of both worlds (Speed and the Rollup plugin ecosytem).


Version published
Weekly downloads
36K
decreased by-80.51%
Maintainers
1
Weekly downloads
 
Created

What is rollup-plugin-esbuild?

The rollup-plugin-esbuild package is a Rollup plugin that integrates esbuild, a fast JavaScript bundler and minifier, into the Rollup build process. It allows you to transpile TypeScript, JSX, and modern JavaScript syntax to older versions of JavaScript, as well as minify the output.

What are rollup-plugin-esbuild's main functionalities?

Transpile TypeScript

This feature allows you to transpile TypeScript files to JavaScript. The code sample demonstrates how to configure rollup-plugin-esbuild to process .ts files and output a CommonJS bundle.

const esbuild = require('rollup-plugin-esbuild');

module.exports = {
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    esbuild({
      include: /\.ts$/,
      minify: false,
      target: 'es2015'
    })
  ]
};

Transpile JSX

This feature allows you to transpile JSX files to JavaScript. The code sample demonstrates how to configure rollup-plugin-esbuild to process .jsx files and output an ES module bundle.

const esbuild = require('rollup-plugin-esbuild');

module.exports = {
  input: 'src/index.jsx',
  output: {
    file: 'dist/bundle.js',
    format: 'esm'
  },
  plugins: [
    esbuild({
      include: /\.jsx$/,
      minify: false,
      target: 'es2015'
    })
  ]
};

Minify JavaScript

This feature allows you to minify JavaScript files. The code sample demonstrates how to configure rollup-plugin-esbuild to minify the output and target ES2015.

const esbuild = require('rollup-plugin-esbuild');

module.exports = {
  input: 'src/index.js',
  output: {
    file: 'dist/bundle.min.js',
    format: 'iife'
  },
  plugins: [
    esbuild({
      minify: true,
      target: 'es2015'
    })
  ]
};

Other packages similar to rollup-plugin-esbuild

FAQs

Package last updated on 15 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc